package com.geor.gcv.core.process;

import org.opencv.core.Mat;
import org.opencv.imgproc.Imgproc;

public class HistProcess extends Process {
	Process process;
	Mat img;

	public HistProcess(Process process) {
		this.process = process;
	}

	public HistProcess(Mat img) {
		this.img = img;
	}

	@Override
	public String getProcessName() {
		if (process == null)
			return "直方图均衡化";
		return process.process() + "-->直方图均衡化";
	}

	@Override
	public Mat process() {
		if (process != null) {
			img = process.process();
		}

		Mat result = new Mat();
		Imgproc.equalizeHist(img, result);

		return result;
	}

}
